package boot

import (
	"gitee.com/jjawesomejj/awesome-util/config"
	"gitee.com/jjawesomejj/awesome-util/helper/commonhelper"
	"gitee.com/jjawesomejj/awesome-util/helper/timeHelper"
)

type ConfigService struct {
}

func (service *ConfigService) Init() {
	config.HandleCommandLineSetToConfig()
	uniqueId := config.GetConfigByKey("unique_id", func() interface{} {
		return nil
	})
	if uniqueId == nil {
		uniqueId = commonhelper.Md5(timeHelper.Now() + commonhelper.Rand(20))
		config.SetConfigByKey("unique_id", uniqueId, true)
	}
}
